using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for WebTool
/// </summary>
public static class WebTool
{
    private static string protocol = "";

    public static String Protocol
    {
        get
        {
            bool secureHttp = false;
            string httpProtocol = HttpContext.Current.Request.Url.ToString();
            if (httpProtocol.Contains("https://"))
            {
                secureHttp = true;
            }
            if (secureHttp)
                return "https://";
            else
                return "http://";
        }
    }
    public static string getWebRoot()
    {
        return Protocol + HttpContext.Current.Request.ServerVariables["HTTP_HOST"] + HttpContext.Current.Request.ApplicationPath;
    }
}
